<template>
    <div>
        <van-nav-bar title="商品列表" left-text="返回" left-arrow @click-left="() => { $router.back() }" fixed />
        <div style="height: 45px;"></div>
        <div v-for="item in searchApiData">
            <!-- <router-link :to="/detail/+item.goods_id"> -->
            <router-link :to="{name:'detail',params:{goods_id:item.goods_id}}">
            <van-card :price="item.goods_price" :title="item.goods_name"
                :thumb="item.goods_big_logo ? item.goods_big_logo : 'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'" />
</router-link>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue';

console.log('电视');
let c = ref('电视');
let searchApiData = ref([])
import { searchApi } from '@/api/api';
searchApi(c).then(res => {
    console.log(res);
    searchApiData.value = res.data.message.goods
})
</script>

<style lang="scss" scoped></style>